package net.qunzhi.modules.cms.controller;

import java.util.Arrays;
import net.qunzhi.common.utils.BaseQuery;
import net.qunzhi.common.annotation.SysLog;
import net.qunzhi.modules.cms.query.StateDateQuery;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import net.qunzhi.modules.cms.entity.TbElectricityStateEntity;
import net.qunzhi.modules.cms.service.TbElectricityStateService;
import net.qunzhi.common.utils.PageUtils;
import net.qunzhi.common.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;


/**
 * 调度中心电量数据
 *
 * @author zjr
 * @date 2021-09-26 14:19:18
 */
@Api(tags = "调度中心电量数据相关")
@RestController
@RequestMapping("cms/tbElectricityState")
public class TbElectricityStateController {
    @Autowired
    private TbElectricityStateService tbElectricityStateService;

    /**
     * 列表
     */
    @ApiOperation("列表")
    @GetMapping("/list")
    @RequiresPermissions("cms:tbElectricityState:list")
    public R list(StateDateQuery query){
        PageUtils page = tbElectricityStateService.queryPage(query);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @ApiOperation("信息")
    @GetMapping("/info/{id}")
    @RequiresPermissions("cms:tbElectricityState:info")
    public R info(@PathVariable("id") Integer id){
		TbElectricityStateEntity tbElectricityState = tbElectricityStateService.getById(id);

        return R.ok().put("tbElectricityState", tbElectricityState);
    }

}
